<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Utility for converting curl commands to code">
    <meta name="author" content="Nick Carneiro">

    <title>Convert cURL command syntax to Python requests, Ansible URI, browser fetch, MATLAB, Node.js, R, PHP, Strest, Go, Dart, Java, JSON, Elixir, and Rust code</title>
    <link href="/styles/app.css" rel="stylesheet">
  </head>
  <body>
  <div class="container">
    <div class="row">
      <div class="col-sm-12">
        <ul class="nav nav-pills pull-right">
          <li><a href="https://github.com/NickCarneiro/curlconverter">GitHub</a></li>
          <li style="padding-top: 8px; padding-left: 10px;"><iframe src="https://ghbtns.com/github-btn.html?user=NickCarneiro&repo=curlconverter&type=watch&count=true&size=large" frameborder="0" scrolling="0" width="170px" height="30px"></iframe></li>
        </ul>
        <h3 class="text-muted hidden-xs">Convert curl syntax to Python, Ansible URI, MATLAB, Node.js, R, PHP, Strest, Go, Dart, Java, JSON, Elixir, Rust</h3>
      </div>
    </div>
    <div class="row">
      <div class="col-sm-6">
        <h2>curl command</h2>
        <textarea id="curl-code" class="code" placeholder="Paste a curl command here"></textarea>
        <div>
          Examples:
          <a id="get-example" href="#">GET</a>
          -
          <a id="post-example" href="#">POST</a>
          -
          <a id="basic-auth-example" href="#">Basic Auth</a>

        </div>

      </div>
      <div class="col-sm-6">
        <h2 id="generated-code-title">Python requests</h2>
        <div style="display: none;" id="issue-promo">If your syntax is correct, create an
          <a href="https://github.com/NickCarneiro/curlconverter/issues/new" target="_blank">issue</a>.
        </div>
        <textarea id="generated-code" class="code"></textarea>

      </div>
    </div>
    <div class="row">
      <div class="col-lg-12 button-container">
        <label for="language">
          Language
        </label>
        <select class="form-control" id="language">
          <option value="ansible">Ansible</option>
          <option value="browser">Browser (fetch)</option>
          <option value="dart">Dart</option>
          <option value="elixir">Elixir</option>
          <option value="go">Go</option>
          <option value="java">Java</option>
          <option value="json">JSON</option>
          <option value="node-fetch">Node.js (fetch)</option>
          <option value="node-request">Node.js (request)</option>
          <option value="matlab">MATLAB</option>
          <option value="php">PHP</option>
          <option value="python" selected="selected">Python</option>
          <option value="r">R</option>
          <option value="rust">Rust</option>
          <option value="strest">Strest</option>
        </select>
      </div>
    </div>
    <div class="row extra-padding">
      <div class="col-lg-2">
        <h3>Curl from Chrome</h3>
        <ul class="chrome">
          <li>1) Open the network tab in DevTools</li>
          <li>2) Ctrl-click a request, "Copy as cURL".</li>
          <li>3) Paste it in the curl command box.</li>
        </ul>
      </div>
      <div class="col-lg-6">
        <img class="screenshot" src="images/newscreenshot.png" srcset="images/newscreenshot@2x.png 2x" alt="screenshot of chrome devtools">
      </div>
      <div class="col-lg-4">
        <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CE7DEK7I&placement=curltrillworkscom" id="_carbonads_js"></script>
      </div>
    </div>
    <div class="row border-top extra-padding">
      <div class="col-sm-4">
        <h3>Support Us</h3>
        <div class="well larger-text">
          <p>GitHub is matching all contributions to this project on <a href="https://github.com/sponsors/NickCarneiro">Github Sponsors</a>.
          This is a surprisingly good deal and I'm not sure how long it's going to last.
          </p>
          <a class="btn btn-primary" href="https://github.com/sponsors/NickCarneiro">
            Contribute Now
          </a>
        </div>
      </div>
      <div class="col-sm-4">
        <h3>Related Tools</h3>
        <ul>
          <li><a href="https://mholt.github.io/curl-to-go/">curl-to-Go</a></li>
          <li><a href="https://incarnate.github.io/curl-to-php/">curl-to-PHP</a></li>
          <li><a href="https://mattcg.github.io/har-to-curl/">HAR-to-curl</a></li>
        </ul>
      </div>
      <div class="col-sm-4">
        <h3>Find a problem?</h3>
        <div class="well larger-text">
          Please report bugs on
          <a href="https://github.com/NickCarneiro/curlconverter">GitHub</a>.
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-lg-12 footer">
        You should follow me on twitter <a href="https://twitter.com/nickc_dev">here</a>.
      </div>
    </div>
  </div>

    <script src="scripts/main.min.js"></script>
  <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-7363929-21', 'auto');
    ga('send', 'pageview');

  </script>
  </body>
</html>
